<template>
  <div class="view-wrapper">
    <div class="head">
      <el-button @click="back">返回列表</el-button>
    </div>
    <div class="detail" v-if="shopType==1">
      <div class="detailFrom">
        <div class="from_head boder_bottom">
          <span class="fromtitle">账单详情</span>
          <div class="from_headR">
            <div class="from_headR1">
              <span>申请提现：</span>
              <span class="num1">¥{{ info.withdrawMoney }}</span>
            </div>
            <div class="from_headR1">
              <span>实际放款：</span>
              <span class="num2">¥{{ info.practicalMoney }}</span>
            </div>
          </div>
        </div>
        <div class="from_detail">
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              提现订单编号：{{ info.withdrawNo }}
            </div>
            <div class="from_detailoneBox">
              账单分类：{{ info.typeDict }}
            </div>
          </div>
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              状态：{{ info.statusDict }}
            </div>
            <div class="from_detailoneBox">备注：{{ info.remark }}</div>
          </div>
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              交易流水号：{{ info.serialNo }}
            </div>
            <div class="from_detailoneBox">
              提现手续费：{{ info.withdrawProcedureFee }}
            </div>
          </div>
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              申请时间：{{ info.createTime }}
            </div>
            <div class="from_detailoneBox">税费：{{ info.taxes }}</div>
          </div>
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              处理时间：{{ info.disposeTime }}
            </div>
            <div class="from_detailoneBox">
              综合服务费：{{ info.serviceFee }}
            </div>
          </div>
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              到账时间：{{ info.receivedTime }}
            </div>
            <div class="from_detailoneBox">银行卡：{{ info.bankNo }}</div>
          </div>
          <div class="from_detailone">
            <div class="from_detailoneBox boder_right">
              商户账号名称：{{ info.merchantName }}
            </div>
            <div class="from_detailoneBox">
              银行支行名称：{{ info.bankBranch }}
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="detail" v-if="shopType==2">
      <div class="detailFrom">
        <div class="from_head boder_bottom">
          <span class="fromtitle">账单详情</span>
          <div class="from_headR">
            <div class="from_headR1">
              <span>申请提现：</span>
              <span class="num1">¥{{ info.withdrawMoney }}</span>
            </div>
            <div class="from_headR1">
              <span>实际放款：</span>
              <span class="num2">¥{{ info.practicalMoney }}</span>
            </div>
          </div>
        </div>
        <div class="from_detail">
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              提现订单编号：{{ info.withdrawNo }}
            </div>
            <div class="from_detailoneBox">
              账单分类：{{ info.typeDict }}
            </div>
          </div>
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              状态：{{ info.statusDict }}
            </div>
            <div class="from_detailoneBox">备注：{{ info.remark }}</div>
          </div>
          <div class="from_detailone boder_bottom">
            <div class="from_detailoneBox boder_right">
              申请时间：{{ info.createTime }}
            </div>
            <div class="from_detailoneBox">
              处理时间：{{ info.disposeTime }}
            </div>
          </div>
          <div class="from_detailone">
            <div class="from_detailoneBox boder_right">
              商户账号名称：{{ info.wecharName }}
            </div>
            <div class="from_detailoneBox">
              到账时间：{{ info.receivedTime }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import {
  adminWithdrawMoneyInfo,
  manualDetailNew,
  manageCustomer,
} from "@/api/moneyManagement";
export default {
  name: "WithdrawalDetails",
  components: {},
  data() {
    return {
      loading: false,
      id: "",
      info: {},
      shopType: "", //类型 1 商户 2 客户
    };
  },
  mounted() {
    let query = this.$route.query;
    this.id = query.id;
    this.shopType = query.shopType;
    this.getinfo();
  },
  methods: {
    getinfo() {
      // const params = {
      //   withdrawNo: this.withdrawNo
      // };
      // this.loading = true;
      // adminWithdrawMoneyInfo(params)
      //   .then((res) => {
      //     this.info = res.result;
      //   })
      //   .finally(() => {
      //     this.loading = false;
      //   });
      if (this.shopType == 1) {
        manualDetailNew(this.id)
          .then((res) => {
            this.info = res.result;
          })
          .finally(() => {});
      }else{
         manageCustomer(this.id)
          .then((res) => {
            this.info = res.result;
          })
          .finally(() => {});
      }
    },
    back() {
      this.$router.push({ path: "/moneyManagement/withdrawal-list" });
    },
  },
};
</script>
<style scoped>
.head {
  margin-bottom: 20px;
}
.detail {
  padding: 20px;
  box-shadow: 0px 4px 12px 0px rgb(1 41 99 / 6%);
  background-color: #fff;
  border-radius: 8px;
}
.detailFrom {
  border: 1px solid #dfe6ec;
}
.fromtitle {
  font-size: 16px;
  font-weight: bold;
}
.from_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f2f6fc;
  padding: 10px 20px;
}
.from_headR {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.from_headR1 {
  margin-left: 20px;
  display: flex;
  align-items: center;
  font-size: 15px;
}
.num1 {
  color: #13ce66;
  font-weight: bold;
}
.num2 {
  color: #e64242;
  font-weight: bold;
}
.from_detailone {
  display: flex;
  align-items: center;
}
.from_detailoneBox {
  padding: 20px 20px;
  width: 50%;
  font-size: 14px;
  color: #303133;
}
.boder_top {
  border-top: 1px solid #dfe6ec;
}
.boder_bottom {
  border-bottom: 1px solid #dfe6ec;
}
.boder_left {
  border-left: 1px solid #dfe6ec;
}
.boder_right {
  border-right: 1px solid #dfe6ec;
}
</style>